<?php defined('_JEXEC') or die('Restricted access'); // no direct access 
JHTML::_('behavior.tooltip');
jimport('joomla.filesystem.file');
$document =& JFactory::getDocument();
$lang =& JFactory::getLanguage();
?>
<?php //echo JText::_('RANDOM PRODUCTS'); ?>
<?php
		$k = 0;
		for ($i=0, $n=count( $products ); $i < $n; $i++)
		{
			$row = $products[$i];

			$link = JRoute::_( 'index.php?option=com_properties&amp;view=property&amp;id='.$row->id);
			?>
<div style="padding-left:20px;*padding-left:0px;"><?php
if($row->image1!=NULL){ 
	$img=$row->image1;
	$destino_imagen = JPATH_SITE.DS.'images'.DS.'properties'.DS.'peques'.DS.'peque_'.$img;
	if (JFile::exists($destino_imagen)){
		$imgTag='<img src="images/properties/peques/peque_'. 
		$img .'" alt="'. str_replace('"',' ',$row->name) .'" width="100" height="75" />';
	}else{
		$img = 'noimage.jpg';
		$imgTag='<img src="images/properties/peques/peque_'. $img .'" width="100" height="75" />';
	}
}else{
	$img = 'noimage.jpg';
	$imgTag='<img src="images/properties/peques/peque_'. $img .'" width="100" height="75" />';
}
?>
<a href="<?php echo $link; ?>"> <?php echo $imgTag;?></a>
<a href="<?php echo $link; ?>"><br/><?php echo $row->name; ?></a><br/><br/>
</div>
<?php
$k = 1 - $k;
}
?>